package swimv2.ejb.entity;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.InheritanceType;

import org.hibernate.annotations.PolymorphismType;

@Entity
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
@Table(name = "Capacita")
public class Capacita implements Serializable,Comparable<Capacita>{

	private static final long serialVersionUID = 1L;
	
	private String descrizione;
	

	private int id;
	
	
	public Capacita(String nome)
	{
		super();
		setDescrizione(nome);
		
	}
	public Capacita()
	{
		super();
		setDescrizione("");
		
	}

	@Column(name="descrizione")
	public String getDescrizione() {
		return descrizione;
	}



	public void setDescrizione(String descrizione) {
		this.descrizione = descrizione;
	}

	  @Id
	  @GeneratedValue(strategy = GenerationType.TABLE)
	  @Column(name="CAPACITA_ID")
	public int getId() {
		return id;
	}
	  public void setId(int id) {
			this.id= id;
		}

	
@Override
public int compareTo(Capacita arg0) {
	return id-arg0.id;

	}
	
}
